<?php
/**
 * 微信小程序服务提供
 * User: zucheng
 * Date: 2019/4/3
 */

namespace App\Providers;

use App\Library\WxxcxHelp;
use Illuminate\Support\ServiceProvider;

class WxxcxServiceProvider extends ServiceProvider
{
    // 延迟加载
    protected $defer = true;

    public function boot()
    {
        //
    }

    /**
     * 注册服务
     * @return void
     */
    public function register()
    {
        // 单例模式创建容器
        $this->app->singleton('wxxcx', function () {
            return new WxxcxHelp(config('wxxcx'));
        });
    }

    /**
     * 获取服务
     * @return array
     */
    public function provides()
    {
        return ['wxxcx'];
    }

}